package cn.tedu.csmall.order.webapi.mapper;

import cn.tedu.csmall.commons.pojo.order.vo.OrderTbl;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.List;

@Repository
public interface OrderMapper {
    //新增订单的Mapper方法
    @Insert("insert into order_tbl(user_id, commodity_code, count, money) " +
            "VALUES (#{userId},#{commodityCode},#{count},#{money})")
    void insertOrder(OrderTbl order);
    //分页查询订单的方法
    @Select("select id, user_id, commodity_code, count, money from order_tbl")
    List<OrderTbl> findAllOrders();
}
